<span class="error">{$errorMsg}</span>
<h2>Lista grup:</h2>
<form action="" method="post">
<input type="hidden" name="mode" value="join" />
<table>
<thead>
<tr><th>Przedmiot</th><th>Grupa</th></tr>
</thead>
{foreach from=$subjects item=sub}
<tr><td>{$sub.name}</td>
<td><select name="subject[{$sub.subjectID}]">
<option value="0">Wolny strzelec</option>
{assign var=tmp value=$sub.subjectID}
{foreach from=$listOfGroups.$tmp item=log}
<option value="{$log.ownerID}" {if $myGroups.$tmp == $log.ownerID}selected{/if}>{$log.surname} {$log.name}</option>
{/foreach}
</select>
</td></tr>
{/foreach}
</table>
<input type="submit" value="dołącz" />
</form>
<h2>Stwórz własną grupę:</h2>
<form method="post" action="">
<input type="hidden" name="mode" value="add" />
Wybierz przedmiot:
<select name="subject">
{foreach from=$subjects item=sub}
<option value="{$sub.subjectID}">{$sub.name}</option>
{/foreach}
</select>
<input type="submit" value="Kreuj" />
</form>
{if $ownGroups}
<h2>Zarządzaj własnymi grupami: </h2>

<table>
<thead>
<tr><th>Przedmiot</th><th></th><th>Członkowie</th></tr>
</thead>
{foreach from=$ownGroups item=ow}
<tr>
<form action="" method="post">
<input type="hidden" name="mode" value="del" />
<input type="hidden" name="group" value="{$ow.subjectID}" />

<td style="padding-bottom: 20px;">
{$ow.name} 
</td>
<td style="padding-bottom: 20px;"><input type="image" src="_gfx/admin_drop.png" title="usuń grupę" name="operaSsie" onclick="return confirm('Kontynuować?');" /></td>
<td style="padding-bottom: 20px;">
{assign var=tmp value=$ow.subjectID}
{foreach from=$ownGroupsMembers.$tmp item=owm}
{$owm.surname} {$owm.name}<br />
{/foreach}

</td>
</form>
</tr>


{/foreach}
</table>
{/if}
